<?php
class Application_Model_Schema_Object {
	protected $_id;
	protected $_hid;
	protected $_name;
	protected $_type;
	protected $_actions = array();

	public function __set($name, $value) {
		$method = 'set' . $name;
		if(!method_exists($this, $method)) {
			throw new Exception('Set Invalid Object Property');
		}
		$this->$method($value);
	}

	public function __get($name) {
		$method = 'get' . $name;
		if(!method_exists($this, $method)) {
			throw new Exception('Get Invalid Object Property');
		}
		return $this->$method();
	}

	public function setId($id) {
		$this->_id = (int) $id;
		return $this;
	}

	public function getId() {
		return $this->_id;
	}

	public function setHid($hid) {
		$this->_hid = (string) $hid;
		return $this;
	}

	public function getHid() {
		return $this->_hid;
	}	

	public function setName($name) {
		$this->_name = (string) $name;
		return $this;
	}

	public function getName() {
		return $this->_name;
	}

	public function setType($type) {
		$this->_type = $type;
		return $this;
	}

	public function getType() {
		return $this->_type;
	}

	public function setAction($action, $key = null) {
		if(isset($key)) {
			$this->_actions[$key] = $action;

		} else {
			$this->_actions[] = $action;
		}
		return $this;
	}

	public function setActions($actions) {
		$this->_actions = $actions;
		return $this;
	}


	public function getActions() {
		return $this->_actions;
	}
}
?>